package com.Test;

import com.suanfa.DiGui;
import com.suanfa.ShuZu;
import com.suanfa.WeiYunSuan;
import com.suanfa.ZiFuChuan;

import java.util.Arrays;

public class ShuZuTest
{
    public static void main(String[] args)
    {
        //构建乘积数组
        int[] a = {1, 2, 3, 4, 5};
        int[] multiply = ShuZu.multiply(a);
        System.out.println(Arrays.toString(multiply));

        //连续子数组的最大和
        int[] b = {1, -2, 3, 10, -4, 7, 2, -5};
        int maxSubArray = ShuZu.findMaxSubArray(b);
        System.out.println(maxSubArray);

        //旋转数组的最小数字
        int[] c = {3, 4, 5, 1, 2};
        int minNumberInRotateArray = ShuZu.minNumberInRotateArray(c);
        System.out.println(minNumberInRotateArray);

        // 数组中出现次数超过一半的数字
        int[] d = {1, 2, 3, 2, 2, 2, 5, 4, 2};
        int moreThanHalfNum = ShuZu.MoreThanHalfNum_Solution(d);
        System.out.println(moreThanHalfNum);

        //数组中重复的数字
        int[] e = {2, 3, 1, 0, 2, 5};
        int[] duplication = new int[6];
        boolean b1 = ShuZu.duplicate(e, 6, duplication);
        System.out.println(b1);


        //数组中只出现一次的数字
        int[] a1 = {2, 3, 3, 4, 2, 1};
        int[] a2 = new int[6];
        int[] a3 = new int[6];
        ShuZu.FindNumsAppearOnce(a1, a2, a3);
        System.out.println(a2[0]);
        System.out.println(a3[0]);


    }


}
